//define(['../module'], function (module) {
define(['app'], function (app) {
  app.registerProvider(
    'baseRouteDefs',
    [
      '$stateProvider',
      '$urlRouterProvider',
      '$couchPotatoProvider',
      function ($stateProvider,
                $urlRouterProvider,
                $couchPotatoProvider) {

        this.$get = function () {
          // this is a config-time-only provider
          // in a future sample it will expose runtime information to the app
          return {};
        };
        var access = routingConfig.accessLevels;

        $stateProvider


          .state('app.base', {
            url: "/base",
            templateUrl: "modules/base/views/main.html",
            controller: 'BaseMainCtrl',
            ncyBreadcrumb: {
              label: '设置'
            },
            resolve: {
              dummy: $couchPotatoProvider.resolveDependencies(['/modules/base/controllers/main.js'])
            }
          })

          .state('app.base.users', {
            url: '/users',
            abstract: true,
            templateUrl: 'modules/base/views/users/main.html',
            controller: 'BaseUsersCtrl1',
            resolve: {
              dummy: $couchPotatoProvider.resolveDependencies(['/modules/base/controllers/users.js'])
            },
            ncyBreadcrumb: {
              label: '用户列表'
            }
          })
          .state('app.base.users.list', {
            url: '',
            templateUrl: 'modules/base/views/users/list.html',
            ncyBreadcrumb: {
              label: '列表'
            }
          })
          .state('app.base.users.view', {
            url: '/:id/view',
            templateUrl: 'modules/base/views/users/view.html',
            controller: 'BaseUsersCtrl1',
            ncyBreadcrumb: {
              label: '查看'
            }
          })
          .state('app.base.users.edit', {
            url: '/:id/edit',
            templateUrl: 'modules/base/views/users/form.html',
            controller: 'BaseUsersCtrl1',
            ncyBreadcrumb: {
              label: '编辑用户'
            }
          })
          .state('app.base.users.add', {
            url: '/add',
            templateUrl: 'modules/base/views/users/form.html',
            controller: 'BaseUsersCtrl1',
            ncyBreadcrumb: {
              label: '新增用户'
            }
          });
      }
    ]
  );
});
